package com.example.human_resource_management.config;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.util.Date;

@Component
public class MyMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        // 自动填充申请时间
        this.strictInsertFill(metaObject, "applyTime", Date.class, new Date());
        // 自动填充审批状态（默认"待审"）
        this.strictInsertFill(metaObject, "approvalStatus", String.class, "待审");
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}